package cheme.ProcessEditor.Parts.ConsoleView;

import org.eclipse.gef.GraphicalEditPart;
import org.eclipse.gef.tools.CellEditorLocator;
import org.eclipse.gef.tools.DirectEditManager;
import org.eclipse.swt.widgets.Text;

import cheme.ProcessModel.HelloModel;

public class MyDirectEditManager extends DirectEditManager
{
	private HelloModel helloModel;

	public MyDirectEditManager(GraphicalEditPart source, Class editorType,
			CellEditorLocator locator)
	{
		super(source, editorType, locator);
		
		helloModel = (HelloModel) source.getModel();
	}
	
	protected void initCellEditor()
	{
		getCellEditor().setValue(helloModel.getText());

		Text text = (Text) getCellEditor().getControl();
		text.selectAll();
	}
}
